<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>传统婚嫁习俗大全（建议收藏）</title>
    <script src="../js/html2canvas.min.js"></script>
</head>
<body style="font-family: 'PingFang SC', 'Helvetica Neue', Arial, 'Microsoft YaHei', sans-serif; line-height: 1.7; color: #333; background: #f8f8f8; padding: 15px; max-width: 480px; margin: 0 auto; position: relative; transition: all 0.3s ease; font-size: 16px;">
    <div class="toolbar" style="position: fixed; right: 15px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000;">
        <button class="tool-btn" id="increaseFont" title="放大文字" style="width: 44px; height: 44px; border-radius: 50%; background-color: #ff3a5c; color: white; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 12px rgba(255, 59, 92, 0.3); transition: all 0.3s ease; font-size: 16px; font-weight: bold;">A+</button>
        <button class="tool-btn" id="decreaseFont" title="缩小文字" style="width: 44px; height: 44px; border-radius: 50%; background-color: #ff3a5c; color: white; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 12px rgba(255, 59, 92, 0.3); transition: all 0.3s ease; font-size: 16px; font-weight: bold;">A-</button>
        <button class="tool-btn" id="exportImage" title="导出长图" style="width: 44px; height: 44px; border-radius: 50%; background-color: #ff3a5c; color: white; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 12px rgba(255, 59, 92, 0.3); transition: all 0.3s ease; font-size: 16px; font-weight: bold;">📷</button>
    </div>
    
    <div class="article-container" id="articleContent" style="background-color: white; border-radius: 8px; overflow: hidden; padding: 25px 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05);">
        <h1 class="title" style="font-size: 22px; font-weight: bold; color: #000; margin-bottom: 20px; line-height: 1.4; text-align: left;">传统婚嫁习俗大全（建议收藏）</h1>
        
        <div class="content" style="font-size: inherit;">
            <p style="margin-bottom: 20px; text-align: justify; color: #333;">中国传统婚嫁习俗源远流长，蕴含着深厚的文化底蕴和美好寓意。尽管时代变迁让许多传统习俗逐渐简化，但了解这些习俗依然能帮助我们更好地理解中华文化的精髓。</p>
            
            <p style="margin-bottom: 20px; text-align: justify; color: #333;">下面将按婚礼流程详细介绍传统婚嫁习俗，无论你是即将步入婚姻的新人，还是对传统文化感兴趣的朋友，都值得收藏。</p>
            
            <div class="highlight" style="background-color: #fff9fa; padding: 20px; border-radius: 8px; margin: 20px 0; border: 1px solid #ffe6e9; position: relative;">
                <p style="margin-bottom: 0; text-align: justify; color: #333;">传统婚嫁习俗不仅是一套仪式流程，更承载着对新人的美好祝福和对婚姻生活的期许。</p>
            </div>
            
            <h2 style="font-size: 18px; margin: 25px 0 15px; color: #000; padding-left: 10px; border-left: 4px solid #ff3a5c; font-weight: bold;">一、婚前准备阶段</h2>
            <p style="margin-bottom: 20px; text-align: justify; color: #333;">传统婚礼从准备阶段就有许多讲究，这些习俗体现了对婚姻的重视：</p>
            
            <div class="numbered-list" style="margin-left: 0; margin-bottom: 25px;">
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">1</span>
                    <strong>提亲</strong> - 男方请媒人到女方家提亲，表达结亲意愿
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">2</span>
                    <strong>合八字</strong> - 交换双方生辰八字，请算命先生测算是否相合
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">3</span>
                    <strong>小定</strong> - 初步确定婚约，男方送简单聘礼到女方家
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">4</span>
                    <strong>大定</strong> - 正式定亲，男方送较重的聘礼，确定婚期
                </div>
            </div>
            
            <div class="quote" style="border-left: 4px solid #ff3a5c; padding-left: 15px; margin: 20px 0; font-style: italic; color: #666; background: #f9f9f9; padding: 15px; border-radius: 0 8px 8px 0;">
                "传统婚俗中，'纳采、问名、纳吉、纳征、请期、亲迎'被称为'六礼'，是古代婚姻成立的必备程序。"
            </div>
            
            <h2 style="font-size: 18px; margin: 25px 0 15px; color: #000; padding-left: 10px; border-left: 4px solid #ff3a5c; font-weight: bold;">二、嫁妆与聘礼</h2>
            <p style="margin-bottom: 20px; text-align: justify; color: #333;">嫁妆和聘礼是传统婚嫁中的重要环节，既有实际意义，也象征双方家庭的诚意：</p>
            
            <div class="numbered-list" style="margin-left: 0; margin-bottom: 25px;">
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">1</span>
                    <strong>聘礼</strong> - 男方送给女方的礼物，通常包括礼金、三金（金项链、金手镯、金戒指）、喜饼等
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">2</span>
                    <strong>嫁妆</strong> - 女方家庭为女儿准备的物品，如家具、床上用品、生活用品等
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">3</span>
                    <strong>回礼</strong> - 女方收到聘礼后，会退回部分或添加其他物品作为回礼
                </div>
            </div>
            
            <div class="warning-box" style="background-color: #fff9f2; border: 1px solid #ffd9b3; border-left: 4px solid #ff9900; padding: 18px; border-radius: 8px; margin: 20px 0;">
                <p style="margin-bottom: 0; text-align: justify; color: #333;"><strong>注意：</strong>现代婚嫁中，聘礼和嫁妆更多是象征性的，应根据双方经济情况量力而行，避免过度攀比。</p>
            </div>
            
            <h2 style="font-size: 18px; margin: 25px 0 15px; color: #000; padding-left: 10px; border-left: 4px solid #ff3a5c; font-weight: bold;">三、婚礼前一天习俗</h2>
            <p style="margin-bottom: 20px; text-align: justify; color: #333;">婚礼前一天有许多准备工作，这些习俗寓意着为新人扫除障碍，迎接美好生活：</p>
            
            <div class="numbered-list" style="margin-left: 0; margin-bottom: 25px;">
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">1</span>
                    <strong>安床</strong> - 选择吉时，由好命婆（父母健在、子女双全的女性）为新婚夫妇安置新床
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">2</span>
                    <strong>铺床</strong> - 在床上撒上红枣、花生、桂圆、莲子，寓意"早生贵子"
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">3</span>
                    <strong>上头</strong> - 婚礼前夜，新人分别在自己家中进行梳头仪式，象征步入成人阶段
                </div>
            </div>
            
            <h2 style="font-size: 18px; margin: 25px 0 15px; color: #000; padding-left: 10px; border-left: 4px solid #ff3a5c; font-weight: bold;">四、迎亲与出嫁</h2>
            <p style="margin-bottom: 20px; text-align: justify; color: #333;">婚礼当天的迎亲环节充满喜庆和仪式感：</p>
            
            <div class="numbered-list" style="margin-left: 0; margin-bottom: 25px;">
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">1</span>
                    <strong>祭祖</strong> - 男方出发迎亲前，先祭拜祖先，祈求婚姻美满
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">2</span>
                    <strong>迎亲队伍</strong> - 传统上由新郎、媒人、亲友及轿夫组成，现代多用婚车
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">3</span>
                    <strong>拦门</strong> - 女方亲友在门口阻拦新郎，要求给红包或完成挑战才放行
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">4</span>
                    <strong>找红鞋</strong> - 新郎要在新娘房间找到被藏起的红色婚鞋，才能接走新娘
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">5</span>
                    <strong>拜别</strong> - 新娘向父母行礼告别，感谢养育之恩
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">6</span>
                    <strong>撑红伞</strong> - 新娘出门时由好命婆或伴娘撑红伞，寓意开枝散叶，也代替传统红盖头
                </div>
            </div>
            
            <div class="quote" style="border-left: 4px solid #ff3a5c; padding-left: 15px; margin: 20px 0; font-style: italic; color: #666; background: #f9f9f9; padding: 15px; border-radius: 0 8px 8px 0;">
                "记得我姐姐出嫁时，母亲为她撑红伞，泪眼婆娑地说：'这把伞护你一路平安，到了婆家要孝顺公婆，和睦相处。'那一刻，所有人都感动落泪。"
            </div>
            
            <h2 style="font-size: 18px; margin: 25px 0 15px; color: #000; padding-left: 10px; border-left: 4px solid #ff3a5c; font-weight: bold;">五、婚礼仪式</h2>
            <p style="margin-bottom: 20px; text-align: justify; color: #333;">传统婚礼仪式庄重而充满象征意义：</p>
            
            <div class="numbered-list" style="margin-left: 0; margin-bottom: 25px;">
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">1</span>
                    <strong>过火盆</strong> - 新娘跨过火盆，象征驱除邪气，生活红红火火
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">2</span>
                    <strong>踩瓦片</strong> - 新娘踩碎瓦片，寓意"过去如瓦碎"，迎接新生活
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">3</span>
                    <strong>拜堂</strong> - 一拜天地，二拜高堂，夫妻对拜，这是婚礼的核心仪式
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">4</span>
                    <strong>敬茶</strong> - 新人向双方父母敬茶，改口称"爸、妈"，父母给红包或首饰作为见面礼
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">5</span>
                    <strong>婚宴</strong> - 宴请亲朋好友，新人逐桌敬酒，接受祝福
                </div>
            </div>
            
            <h2 style="font-size: 18px; margin: 25px 0 15px; color: #000; padding-left: 10px; border-left: 4px solid #ff3a5c; font-weight: bold;">六、回门习俗</h2>
            <p style="margin-bottom: 20px; text-align: justify; color: #333;">回门是婚礼后的重要环节，新娘首次携新郎回娘家，具有特殊意义：</p>
            
            <div class="numbered-list" style="margin-left: 0; margin-bottom: 25px;">
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">1</span>
                    <strong>回门时间</strong> - 通常为婚后第三天，也有地区是第二天、第六天或第九天
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">2</span>
                    <strong>回门礼物</strong> - 新人需准备礼品，通常为双数，寓意成双成对
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">3</span>
                    <strong>回门宴</strong> - 女方家设宴款待新女婿，邀请亲友共同庆祝
                </div>
                <div style="margin-bottom: 15px; position: relative; padding-left: 30px;">
                    <span style="background-color: #ff3a5c; color: white; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; position: absolute; left: 0; top: 2px; font-weight: bold;">4</span>
                    <strong>禁忌注意</strong> - 部分地区有"新婚一个月内不空房"、"回门不留宿"等习俗
                </div>
            </div>
            
            <div class="quote" style="border-left: 4px solid #ff3a5c; padding-left: 15px; margin: 20px 0; font-style: italic; color: #666; background: #f9f9f9; padding: 15px; border-radius: 0 8px 8px 0;">
                "回门时，新娘的父母会准备丰盛的宴席，并邀请亲朋好友一同庆祝，这是对新婚夫妇的美好祝福，也象征着两个家庭的正式融合。"
            </div>
            
            <div class="warning-box" style="background-color: #fff9f2; border: 1px solid #ffd9b3; border-left: 4px solid #ff9900; padding: 18px; border-radius: 8px; margin: 20px 0;">
                <p style="margin-bottom: 0; text-align: justify; color: #333;"><strong>温馨提示：</strong>不同地区的回门习俗略有差异，新人应提前了解当地风俗，做好准备。</p>
            </div>
            
            <div class="divider" style="height: 1px; background: linear-gradient(90deg, transparent, #ddd, transparent); margin: 30px 0;"></div>
            
            <div class="highlight" style="background-color: #fff9fa; padding: 20px; border-radius: 8px; margin: 20px 0; border: 1px solid #ffe6e9; position: relative;">
                <p style="margin-bottom: 0; text-align: justify; color: #333;"><strong>文化价值：</strong>传统婚嫁习俗不仅是形式，更承载着家族传承、孝道文化、人际关系等多重社会功能，是中华文化的重要组成部分。</p>
            </div>
            
            <p style="margin-bottom: 20px; text-align: justify; color: #333;">随着时代变迁，许多传统习俗已简化或融入现代元素，但了解这些习俗的起源和寓意，能让我们在策划婚礼时更有文化底蕴，也能更好地传承中华优秀传统文化。</p>
            
            <p style="margin-bottom: 20px; text-align: justify; color: #333;">希望这份传统婚嫁习俗大全能帮助你了解中华婚嫁文化的精髓，无论是用于自己的婚礼筹备，还是作为文化知识收藏，都极具价值。</p>
            
            <div class="divider" style="height: 1px; background: linear-gradient(90deg, transparent, #ddd, transparent); margin: 30px 0;"></div>
            
            <div class="interaction-section" style="background-color: #fff0f5; padding: 20px; border-radius: 8px; margin: 20px 0; border: 1px solid #ffcce0;">
                <h3 style="font-size: 18px; margin-top: 0; color: #d6336c; font-weight: bold;">互动话题：分享你的婚嫁习俗故事</h3>
                
                <div class="topic-list" style="margin-bottom: 20px;">
                    <div style="margin-bottom: 15px; padding: 15px; background-color: white; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.05);">
                        <p style="margin: 0; font-weight: bold; color: #333;">话题1：你家乡最特别的婚嫁习俗是什么？</p>
                        <p style="margin: 8px 0 0; color: #666;">每个地区都有自己独特的婚嫁传统，欢迎分享你家乡最具特色的婚嫁习俗。</p>
                    </div>
                    
                    <div style="margin-bottom: 15px; padding: 15px; background-color: white; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.05);">
                        <p style="margin: 0; font-weight: bold; color: #333;">话题2：现代婚礼中，你会保留哪些传统习俗？</p>
                        <p style="margin: 8px 0 0; color: #666;">在现代简化的婚礼流程中，哪些传统习俗是你认为必须保留的？</p>
                    </div>
                    
                    <div style="margin-bottom: 15px; padding: 15px; background-color: white; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.05);">
                        <p style="margin: 0; font-weight: bold; color: #333;">话题3：你经历过最难忘的婚礼习俗是什么？</p>
                        <p style="margin: 8px 0 0; color: #666;">无论是自己的婚礼还是参加别人的婚礼，哪个习俗环节让你印象最深刻？</p>
                    </div>
                </div>
                
                <div class="share-prompt" style="text-align: center; padding: 15px; background-color: #ffe6f0; border-radius: 6px;">
                    <p style="margin: 0; color: #d6336c; font-weight: bold;">欢迎在评论区分享你的故事和观点，一起探讨中华传统婚嫁文化的魅力！</p>
                </div>
            </div>
        </div>
    </div>
    
    <div class="image-preview" id="imagePreview" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.85); display: none; align-items: center; justify-content: center; z-index: 2000;">
        <div class="preview-content" style="max-width: 90%; max-height: 90%; background-color: white; border-radius: 8px; padding: 20px; position: relative;">
            <button class="close-preview" id="closePreview" style="position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 24px; cursor: pointer; color: #666;">×</button>
            <img class="preview-image" id="previewImage" src="" alt="文章长图预览" style="max-width: 100%; max-height: 80vh; display: block; margin: 0 auto;">
            <button class="download-btn" id="downloadImage" style="display: block; margin: 15px auto 0; padding: 10px 20px; background-color: #ff3a5c; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 16px;">下载文章图片</button>
        </div>
    </div>

    <script>
        let currentFontSize = 16;
        
        document.getElementById('increaseFont').addEventListener('click', function() {
            if (currentFontSize < 24) {
                currentFontSize += 2;
                updateFontSize();
            }
        });
        
        document.getElementById('decreaseFont').addEventListener('click', function() {
            if (currentFontSize > 12) {
                currentFontSize -= 2;
                updateFontSize();
            }
        });
        
        function updateFontSize() {
            document.body.style.fontSize = currentFontSize + 'px';
            
            const title = document.querySelector('.title');
            const baseTitleSize = 22;
            title.style.fontSize = (baseTitleSize * currentFontSize / 16) + 'px';
            
            const subTitles = document.querySelectorAll('h2');
            const baseSubTitleSize = 18;
            subTitles.forEach(subTitle => {
                subTitle.style.fontSize = (baseSubTitleSize * currentFontSize / 16) + 'px';
            });
        }
        
        document.getElementById('exportImage').addEventListener('click', function() {
            const articleContent = document.getElementById('articleContent');
            
            const originalText = this.innerHTML;
            this.innerHTML = '生成中...';
            this.disabled = true;
            
            html2canvas(articleContent, {
                scale: 2,
                useCORS: true,
                allowTaint: true,
                backgroundColor: '#ffffff'
            }).then(canvas => {
                this.innerHTML = originalText;
                this.disabled = false;
                
                const preview = document.getElementById('imagePreview');
                const previewImage = document.getElementById('previewImage');
                
                previewImage.src = canvas.toDataURL('image/png');
                preview.style.display = 'flex';
            }).catch(error => {
                console.error('生成图片失败:', error);
                alert('生成图片失败，请重试');
                this.innerHTML = originalText;
                this.disabled = false;
            });
        });
        
        document.getElementById('closePreview').addEventListener('click', function() {
            document.getElementById('imagePreview').style.display = 'none';
        });
        
        document.getElementById('downloadImage').addEventListener('click', function() {
            const previewImage = document.getElementById('previewImage');
            const link = document.createElement('a');
            link.download = '传统婚嫁习俗大全.png';
            link.href = previewImage.src;
            link.click();
        });
    </script>
</body>
</html>